import request from '@/utils/request'

// 查询品牌列表
export function listBrand (query) {
  return request({
    url: '/system/brand/list',
    method: 'get',
    params: query
  })
}

// 查询品牌详细
export function getBrand (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/brand/getInfo',
    method: 'get',
    params: params
  })
}

// 新增品牌
export function addBrand (data) {
  return request({
    url: '/system/brand/insert',
    method: 'post',
    data: data
  })
}

// 修改品牌
export function updateBrand (data) {
  return request({
    url: '/system/brand/update',
    method: 'post',
    data: data
  })
}

// 删除品牌
export function delBrand (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/brand/delete',
    method: 'post',
    params: params
  })
}
// 批量删除品牌
export function delBatchBrand (ids) {
  const params = {
    'ids': ids
  }
  return request({
    url: '/system/brand/deleteBatch',
    method: 'post',
    params: params
  })
}

// 导入品牌
export function importData (data) {
  return request({
    url: '/system/brand/importData',
    method: 'post',
    data: data
  })
}
